(function(){
	
	Ext.define('NetShopping.goodsStockRecords.GoodsStockRecordsForm',{
		extend:'AppView.base.BaseForm',
		alias:'widget.goodsstockrecordsform',
		defaults:{xtype:'textfield',labelWidth:60,anchor:'100%'},
		url:'/goodsStockRecords/save.do',
		items:[
			{
				hidden:true,
				name:'id'
			}, 
			{
				hidden:true,
				name:'goodsId'
			}, 
			{
				fieldLabel:'商品',
				allowBlank:false,
				readOnly:true,
				name:'goodsName',
				listeners:{
					focus:function(me, The, eOpts ){
						var src = this;
						var win = Ext.create('NetShopping.goods.GoodsBaseSelWin',{
							returnResult:function(result){
								src.setValue(result.raw.goodsName);
								src.up('form').down('[name=goodsId]').setValue(result.raw.id)
					        }
						});
						win.show();
					}
				}
			},
			{
				fieldLabel:'进货数量',
				xtype:'numberfield',
				name:'goodsNum',
				value:0,
				minValue:0
			},
			{
				fieldLabel:'进货价格',
				xtype:'numberfield',
				name:'goodsPrice',
				value:0,
				minValue:0
			}
			,
			{
				xtype:'textarea',
				name:'remark',
				fieldLabel:'备注'
			}
		]
	})
	
	Ext.define('NetShopping.goodsStockRecords.GoodsStockRecordsWin',{
		extend:'AppView.base.FormWin',
		alias:'widget.goodsstockrecordswin',
		title:'进货管理',
		viewUrl:'/goodsStockRecords/view.do',
		height:300,
		items:[
			{
				xtype:'goodsstockrecordsform'
			}
		]
	})
})()